home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbpong1a / intro.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-07  |  1.9 KB  |  65 lines

  1. VERSION 5.00
  2. Begin VB.Form intro 
  3.    BorderStyle     =   0  'None
  4.    Caption         =   "Intro"
  5.    ClientHeight    =   4500
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   4500
  9.    LinkTopic       =   "Form1"
  10.    Picture         =   "intro.frx":0000
  11.    ScaleHeight     =   300
  12.    ScaleMode       =   3  'Pixel
  13.    ScaleWidth      =   300
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.Timer tmrUnload 
  17.       Interval        =   5000
  18.       Left            =   0
  19.       Top             =   0
  20.    End
  21. Attribute VB_Name = "intro"
  22. Attribute VB_GlobalNameSpace = False
  23. Attribute VB_Creatable = False
  24. Attribute VB_PredeclaredId = True
  25. Attribute VB_Exposed = False
  26. Dim rgn As Long
  27. Dim bActive As Boolean
  28. Dim balls(0 To 3) As New ball
  29. Private Sub Form_Click()
  30.     bActive = False
  31. End Sub
  32. Private Sub Form_KeyPress(KeyAscii As Integer)
  33.     If KeyAscii = vbKeyEscape Then bActive = False
  34. End Sub
  35. Private Sub Form_Load()
  36.     Me.Show
  37.     bActive = True
  38.     For i = 0 To UBound(balls)
  39.         balls(i).SetXYVel Int(Rnd * 5) + 3, Int(Rnd * 5) + 3
  40.         balls(i).SetXY Int(Rnd * GetSystemMetrics(SM_CXSCREEN)) - 90, Int(Rnd * GetSystemMetrics(SM_CYSCREEN)) - 90
  41.     Next i
  42.     SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
  43.     rgn = CreateRoundRectRgn(0, 0, Me.ScaleWidth, Me.ScaleHeight, Me.ScaleWidth, Me.ScaleHeight)
  44.     SetWindowRgn Me.hWnd, rgn, True
  45.     While (bActive)
  46.         DoEvents
  47.         
  48.         For i = 0 To UBound(balls)
  49.             balls(i).Move
  50.             balls(i).Update
  51.         Next i
  52.     Wend
  53.     For i = 0 To UBound(balls)
  54.         balls(i).xit
  55.     Next i
  56.     Unload Me
  57. End Sub
  58. Private Sub Form_Unload(Cancel As Integer)
  59.     DeleteObject rgn
  60.     Shell "VBPong.exe", vbNormalFocus
  61. End Sub
  62. Private Sub tmrUnload_Timer()
  63.     bActive = False
  64. End Sub
  65.